#ifndef CHAN_H
#define	CHAN_H
#include <stdint.h>

typedef struct chan_st
{
	int	fd;
}chan_t;

chan_t *chan_open(char *ip, uint16_t port);
int chan_send(chan_t *chan, uint8_t *data, int len);
int chan_recv(chan_t *chan, uint8_t *buf, int len);
int chan_recv2(chan_t *chan, uint8_t *buf, int len);
void chan_close(chan_t *chan);

chan_t *chan_listen(char *ip, uint16_t port);
chan_t *chan_accept(chan_t *chan);

#endif
